Skip to content

Conversation

@aylen384
Copy link
Contributor

@aylen384 aylen384 commented Oct 10, 2025

When opening a dir, the dir is listed.
When viewing a dir listing and positioning the cursor over a file name and pressing Ctrl-O,
the file name is used as the default value for the filename prompt.

robert-hh and others added 2 commits September 15, 2025 16:38
When opening a dir the dir is listed.
When viewing a dir listing and positioning the cursor over a file name and pressing Ctrl-O,
the file name is used as the default value for the filename prompt.
key = self.handle_edit_keys(key, char)
if key == KEY_QUIT:
if self.hash != self.hash_buffer():
if self.hash != self.hash_buffer() and not self.is_dir:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Directory listings were intentionally included into the change check. I do not think that this is a major problem.

os.chdir(fname)
if fname in (".", "..", "") or (os.stat(fname)[0] & 0x4000): ## Dir
os.chdir(fname or ".")
self.work_dir = os.getcwd() # let the os module do the normalization
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty file name is meant to open an edit window without a file name, not a directory listing.

elif key == KEY_GET:
f = slot[index].line_edit("Open file: ", "", Editor.file_char)
dfn = slot[index].content[slot[index].cur_line].strip() if slot[index].is_dir else ""
f = slot[index].line_edit("Open file: ", dfn, Editor.file_char)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To take the file name at the cursor as default name seems intuitive. ATM, you can use CTRL-V in the file name field to copy the text under the cursor. The same thing applies for find.

@robert-hh
Copy link
Owner

Thank you for the PR. I have to think about it. I hope that you noticed, that only pye_core has to be edited. Once you run strip.sh, the other files will be created.

@robert-hh robert-hh force-pushed the master branch 2 times, most recently from a10f174 to b72717f Compare October 12, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants